﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace ProtoType
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        PrototypeCls prototype = new PrototypeCls() { Name = "美女" };
        private void button1_Click(object sender, EventArgs e)
        {
            var protoNew = prototype.Clone();
            if (protoNew is PrototypeCls pro)
            {
                //显然是不同的，引用地址不同
                Console.WriteLine(pro.Name);
                Console.WriteLine(pro.Equals(prototype) ? "引用地址相同" : "引用地址不同");
               
            }
        }
    }
}
